package cn.udrm.water.base.v1.manager.dto;

import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import cn.udrm.water.base.v1.manager.entities.BaseDepartment;

@Mapper(componentModel="spring")
public interface BaseDepartmentDtoMapper {

	
	@Mappings({
		@Mapping(source="parent.id", target="parentGuid"),
		@Mapping(source="parent.name", target="parentName"),
		@Mapping(source="organization.id", target="organizationGuid"),
		@Mapping(source="organization.name", target="organizationName")
	})
	public BaseDepartmentDto from(BaseDepartment baseDepartment);
	public BaseDepartment fromBaseDepartmentDto(BaseDepartmentDto baseDepartmentDto);
	
	public List<BaseDepartmentDto> from(List<BaseDepartment> baseDepartment);
}
